# 创建时间：2025/5/4 星期日 20:50
# 创建人：李德才

from enum import Enum


class Color(Enum):
    RED = 1
    GREEN = 2
    BLUE = 3


print(Color.RED)
print(Color.RED.value)
print(Color.RED.name)
print(Color(1))
print(Color(1).value)
print(Color(1).name)
print(Color['RED'])
print(Color['RED'].value)


color = Enum('Color', ['RED', 'GREEN', 'BLUE'])
print(color.RED)
print(color.RED.value)
print(color.RED.name)
print(color(1))
print(color(1).value)
print(color(1).name)